package com.huajiao.management_system.prove;

import com.huajiao.management_system.bean.competitionRes;
import com.huajiao.management_system.dao.*;
import com.huajiao.management_system.service.proveService;
import io.swagger.models.auth.In;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.lang.reflect.Array;
import java.util.*;

/**
 * @Author: yuan
 * @Date: 2020/5/18 17:22
 * @Version 1.0
 */
@SpringBootTest
@RunWith(SpringRunner.class)
public class test {
    @Resource
    competitionResMapper competitionResMapper;
    @Resource
    honorResMapper honorResMapper;
    @Resource
    paperResMapper paperResMapper;
    @Resource
    patentResMapper patentResMapper;
    @Resource
    softwarecopyrightResMapper softwarecopyrightResMapper;
    @Resource
    proveService proveService;
//    @Test
//    public void test(){
//        Map<String, String> map = new HashMap();
//        map.put("keyword", "");
//        Map<String, Integer> result = new HashMap<>();
//        result.put("competitionRes", competitionResMapper.getTotal(map));
//        result.put("honorRes", honorResMapper.getTotal(map));
//        result.put("paperRes", paperResMapper.getTotal(map));
//        result.put("patentRes", patentResMapper.getTotal(map));
//        result.put("softwarecopyrightRes", softwarecopyrightResMapper.getTotal(map));
//        result.put("total", result.get("competitionRes") +
//                            result.get("honorRes") +
//                            result.get("paperRes") +
//                            result.get("patentRes") +
//                            result.get("softwarecopyrightRes"));
//        for (String s : result.keySet()) {
//            System.out.println(s + ": " + result.get(s));
//        }
//    }

//    @Test
//    public void test1(){
//        Map<String, String> map = new HashMap();
//        map.put("keyword", "");
//        Calendar date = Calendar.getInstance();
//        String year = String.valueOf(date.get(Calendar.YEAR));
//        Map<String, Integer> result = new HashMap<>();
//        for (int i = 2016; i <= Integer.valueOf(year); i++) {
//            map.put("Time", String.valueOf(i));
//            int count = 0;
//            count = competitionResMapper.getTotal(map) +
//                    honorResMapper.getTotal(map) +
//                    paperResMapper.getTotal(map) +
//                    patentResMapper.getTotal(map) +
//                    softwarecopyrightResMapper.getTotal(map);
//            result.put(String.valueOf(i), count);
//        }
//        for (String s : result.keySet()) {
//            System.out.println(s + ": " + result.get(s));
//        }
//    }
//    @Test
//    public void test1(){
//        List<String> deleteUrl = proveService.getDeleteUrl();
//        deleteUrl.forEach(s -> {
//            System.out.println(s);
//        });
//    }
}
